From 998feeb2bc3e37275cfe915e128179d2704ca9c8 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 16 Oct 2014 17:00:20 +0200 Subject: [PATCH] spinbutton: Set the correct state on the button contexts With the recent save-is-child changes, using gtk_style_context_get_padding (context, different_state) will now open a subelement. This is not what we want, so we check the state whenever we get the button contexts. --- gtk/gtkspinbutton.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 770f242adb..b191784e48 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -922,9 +922,13 @@ gtk_spin_button_panel_get_context (GtkSpinButton *spin_button, panel == priv->down_panel); } + gtk_style_context_set_state (*contextp, gtk_spin_button_panel_get_state (spin_button, panel)); + return *contextp; } +#include "gtkcsssectionprivate.h" + static void gtk_spin_button_panel_get_size (GtkSpinButton *spin_button, GdkWindow *panel, @@ -940,7 +944,7 @@ gtk_spin_button_panel_get_size (GtkSpinButton *spin_button, icon_size = MAX (w, h); context = gtk_spin_button_panel_get_context (spin_button, panel); - state = gtk_spin_button_panel_get_state (spin_button, panel); + state = gtk_style_context_get_state (context); gtk_style_context_get_padding (context, state, &button_padding); gtk_style_context_get_border (context, state, &button_border); @@ -1031,7 +1035,6 @@ gtk_spin_button_panel_draw (GtkSpinButton *spin_button, { GtkSpinButtonPrivate *priv = spin_button->priv; GtkStyleContext *context; - GtkStateFlags state; GtkWidget *widget; gdouble width, height, x, y; gint icon_width, icon_height; @@ -1043,8 +1046,6 @@ gtk_spin_button_panel_draw (GtkSpinButton *spin_button, gtk_cairo_transform_to_window (cr, widget, panel); context = gtk_spin_button_panel_get_context (spin_button, panel); - state = gtk_spin_button_panel_get_state (spin_button, panel); - gtk_style_context_set_state (context, state); height = gdk_window_get_height (panel); width = gdk_window_get_width (panel); -- 2.30.2